This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
bizarre loop behavior
- To: egcs-bugs at cygnus dot com
- Subject: bizarre loop behavior
- From: Toshiyasu Morita <tm at netcom dot com>
- Date: Tue, 15 Dec 1998 18:06:26 -0800 (PST)
- Cc: amylaar at cygnus dot com
version: egcs cvs-19981215
host: i386-linux
config: ./configure --target=sh-hms
source: ftp://shell14.ba.best.com/pub.t/tm2/infblock.i
options: -O2 -m4-single-only -ml -S -g
I found a bizarre corner case where loop duplicates the exit code(?) for a
loop several times. Here's a fragment of the output code:
...
1823 L146:
360:infblock.c **** case BAD:
361:infblock.c **** r = Z_DATA_ERROR;
362:infblock.c **** LEAVE
1825 0a80 D819 mov.l r13,@(32,r9)
1826 0a82 B719 mov.l r11,@(28,r9)
1827 0a84 EA53 mov.l @(40,r14),r3
1829 0a86 6DA0 bra L161
1830 0a88 FDE2 mov #-3,r2
1831 0a8a 09000900 .align 5
1831 09000900
1831 09000900
1831 09000900
1831 09000900
1832 L154: <- here
1833 0aa0 A261 mov.l @r10,r1
1834 0aa2 211A mov.l r2,@(4,r10)
1835 0aa4 E952 mov.l @(36,r14),r2
1836 0aa6 D819 mov.l r13,@(32,r9)
1837 0aa8 E953 mov.l @(36,r14),r3
1838 0aaa 1832 sub r1,r2
1839 0aac A251 mov.l @(8,r10),r1
1840 0aae EB54 mov.l @(44,r14),r4
1841 0ab0 322A mov.l r3,@r10
1842 0ab2 2C31 add r2,r1
1843 0ab4 121A mov.l r1,@(8,r10)
1844 0ab6 3AD1 mov.l L217,r1
1845 0ab8 4D19 mov.l r4,@(52,r9)
1846 0aba A365 mov r10,r5
1847 0abc 61A0 bra L166
1848 0abe E856 mov.l @(32,r14),r6
1849 .align 5
1850 L155: <- here
1851 0ac0 A261 mov.l @r10,r1
1852 0ac2 211A mov.l r2,@(4,r10)
1853 0ac4 E952 mov.l @(36,r14),r2
1854 0ac6 D819 mov.l r13,@(32,r9)
1855 0ac8 E953 mov.l @(36,r14),r3
1856 0aca 1832 sub r1,r2
1857 0acc A251 mov.l @(8,r10),r1
1858 0ace EB54 mov.l @(44,r14),r4
1859 0ad0 322A mov.l r3,@r10
1860 0ad2 2C31 add r2,r1
1861 0ad4 121A mov.l r1,@(8,r10)
1862 0ad6 32D1 mov.l L217,r1
1863 0ad8 4D19 mov.l r4,@(52,r9)
1864 0ada A365 mov r10,r5
1865 0adc 51A0 bra L166
1866 0ade E856 mov.l @(32,r14),r6
1867 .align 5
1868 L156: <- here
1869 0ae0 A261 mov.l @r10,r1
1870 0ae2 211A mov.l r2,@(4,r10)
1871 0ae4 E952 mov.l @(36,r14),r2
...
basically the code at L154, L155, L156, L157, L158, and L159 is identical.
Toshi