optimization/9570: Assember error with -finline-functions with g++-3.3

adam@os.inf.tu-dresden.de adam@os.inf.tu-dresden.de
Tue Feb 4 13:46:00 GMT 2003


>Number:         9570
>Category:       optimization
>Synopsis:       Assember error with -finline-functions with g++-3.3
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 04 13:46:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Adam Lackorzynski
>Release:        gcc version 3.3 20030203 (prerelease),
>Organization:
>Environment:
Debian Woody/3.0_r1, x86, Linux 2.4.20, SMP
>Description:
Hi,

compiling the attached code with

g++ -c -fno-rtti  -fno-exceptions -march=i586  -fno-defer-pop -freg-struct-return -g -Wall -W -finline-limit=2000 -finline-functions -O2 profile.ii -o profile.o -save-temps

gives the following assembler error:
profile.s: Assembler messages:
profile.s:501: Error: attempt to .org backwards

When removing -finline-functions (or using -O2 instead of -O3) it compiles fine.
It also works with g++-3.2.

The GNU as version is
GNU assembler version 2.13.90.0.16 (i386-linux) using BFD version 2.13.90.0.16 20021126 Debian GNU/Linux

I don't know if this behaviour could also be related to "as".
>How-To-Repeat:

>Fix:
Don't use -finline-functions or -O3 or higher, or use g++-3.2
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="profile.ii"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="profile.ii"

IyAxICJhdXRvL3Byb2ZpbGUuY2MiCiMgMSAiPGJ1aWx0LWluPiIKIyAxICI8Y29tbWFuZCBsaW5l
PiIKIyAxICJhdXRvL3Byb2ZpbGUuY2MiCgoKIyAxICJhdXRvL3Byb2ZpbGUuaCIgMQoKCgoKCiMg
MSAiLi4vc3JjL3R5cGVzL3R5cGVzLmgiIDEKIyAxMSAiLi4vc3JjL3R5cGVzL3R5cGVzLmgiCiMg
MSAiL2hvbWUvYWRhbS9lcndpbi90bXAvZ2NjLzMuMy9pb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bG9uZyBpLCBsb25nIGxvbmcgaiApIHsgcmV0dXJuIGxsZGl2KGksaik7IH0KCn07CiMgNyAi
YXV0by9wcm9maWxlX2kuaCIgMgojIDEgIi4uL3NyYy9saWIva2Vybi9pbmNsdWRlL2ZsdXgveDg2
L3NlZy5oIiAxCiMgNDQgIi4uL3NyYy9saWIva2Vybi9pbmNsdWRlL2ZsdXgveDg2L3NlZy5oIgpz
dHJ1Y3QgeDg2X2Rlc2MgewogICAgICAgIHVuc2lnbmVkIGludCBsaW1pdF9sb3c6MTYsCiAgICAg
ICAgICAgICAgICAgICAgICAgIGJhc2VfbG93OjE2LAogICAgICAgICAgICAgICAgICAgICAgICBi
YXNlX21lZDo4LAogICAgICAgICAgICAgICAgICAgICAgICBhY2Nlc3M6OCwKICAgICAgICAgICAg
ICAgICAgICAgICAgbGltaXRfaGlnaDo0LAogICAgICAgICAgICAgICAgICAgICAgICBncmFudWxh
cml0eTo0LAogICAgICAgICAgICAgICAgICAgICAgICBiYXNlX2hpZ2g6ODsKfTsKCgoKCnN0cnVj
dCB4ODZfZ2F0ZSB7CiAgICAgICAgdW5zaWduZWQgaW50IG9mZnNldF9sb3c6MTYsCiAgICAgICAg
ICAgICAgICAgICAgICAgIHNlbGVjdG9yOjE2LAogICAgICAgICAgICAgICAgICAgICAgICB3b3Jk
X2NvdW50OjgsCiAgICAgICAgICAgICAgICAgICAgICAgIGFjY2Vzczo4LAogICAgICAgICAgICAg
ICAgICAgICAgICBvZmZzZXRfaGlnaDoxNjsKfTsKIyAxMjcgIi4uL3NyYy9saWIva2Vybi9pbmNs
dWRlL2ZsdXgveDg2L3NlZy5oIgpzdHJ1Y3QgcHNldWRvX2Rlc2NyaXB0b3IKewogICAgICAgIHNo
b3J0IHBhZDsKICAgICAgICB1bnNpZ25lZCBzaG9ydCBsaW1pdDsKICAgICAgICB1bnNpZ25lZCBs
b25nIGxpbmVhcl9iYXNlOwp9OwoKCgpleHRlcm4gX19pbmxpbmUgdm9pZApmaWxsX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ogICAgICAgIGludCBzczE7CiAgICAgICAgaW50IGVzcDI7
CiAgICAgICAgaW50IHNzMjsKICAgICAgICBpbnQgY3IzOwoKICAgICAgICBpbnQgZWlwOwogICAg
ICAgIGludCBlZmxhZ3M7CiAgICAgICAgaW50IGVheDsKICAgICAgICBpbnQgZWN4OwogICAgICAg
IGludCBlZHg7CiAgICAgICAgaW50IGVieDsKICAgICAgICBpbnQgZXNwOwogICAgICAgIGludCBl
YnA7CiAgICAgICAgaW50IGVzaTsKICAgICAgICBpbnQgZWRpOwogICAgICAgIGludCBlczsKICAg
ICAgICBpbnQgY3M7CiAgICAgICAgaW50IHNzOwogICAgICAgIGludCBkczsKICAgICAgICBpbnQg
ZnM7CiAgICAgICAgaW50IGdzOwogICAgICAgIGludCBsZHQ7CiAgICAgICAgdW5zaWduZWQgc2hv
cnQgdHJhY2VfdHJhcDsKICAgICAgICB1bnNpZ25lZCBzaG9ydCBpb19iaXRfbWFwX29mZnNldDsK
Cgp9OwojIDIxMiAiYXV0by9rbWVtLmgiIDIKIyAyMjcgImF1dG8va21lbS5oIgppbmxpbmUgdm9p
ZCAqa21lbTo6cGh5c190b192aXJ0KHZtX29mZnNldF90IGFkZHIpCnsKICByZXR1cm4gcmVpbnRl
cnByZXRfY2FzdDx2b2lkICo+KGFkZHIgKyBtZW1fcGh5cyk7Cn0KCgoKCgppbmxpbmUgdm9pZCBr
bWVtOjp0bGJfZmx1c2godm1fb2Zmc2V0X3QgYWRkcikKewogIGFzbSB2b2xhdGlsZQogICAgKCJp
bnZscGcgJTAiIDogOiAibSIgKCooY2hhciopYWRkcikgOiAibWVtb3J5Iik7Cn0KCgoKCmlubGlu
ZSB2b2lkIGttZW06OnRsYl9mbHVzaCgpCnsKCiAgdW5zaWduZWQgZHVtbXk7CiAgYXNtIHZvbGF0
aWxlICgiIG1vdiAlJWNyMywlMDsgbW92ICUwLCUlY3IzICIgOiAiPXIiKGR1bW15KSApOwp9CiMg
MjYxICJhdXRvL2ttZW0uaCI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ICB0eXBlZGVmIHN0cnVjdCBfX2F0dHJpYnV0ZV9fKChwYWNrZWQpKQogICAgewogICAgICB1
bnNpZ25lZCBudW1iZXI7CiAgICAgIHVuc2lnbmVkIGVpcDsKICAgICAgQ29udGV4dCAqY3VycmVu
dDsKICAgICAgdW5zaWduZWQgbG9uZyBsb25nIHRzYzsKICAgICAgdW5zaWduZWQgbG9uZyBsb25n
IHBtYzsKICAgICAgdW5pb24gX19hdHRyaWJ1dGVfXygocGFja2VkKSkKICAgICAgICB7CiAgICAg
ICAgICBzdHJ1Y3QgX19hdHRyaWJ1dGVfXygocGFja2VkKSkKICAgICAgICAgICAgewoKICAgICAg
ICAgICAgICB1bnNpZ25lZCBlYXgsIGVkeCwgZWJ4LCBlYnA7CiAgICAgICAgICAgICAgVW5zaWdu
ZWQ2NCBkZXN0OwogICAgICAgICAgICB9IGlwYzsKICAgICAgICAgIHN0cnVjdCBfX2F0dHJpYnV0
ZV9fKChwYWNrZWQpKQogICAgICAgICAgICB7CgogICAgICAgICAgICAgIHVuc2lnbmVkIGVheCwg
ZWR4LCBlYng7CiAgICAgICAgICAgICAgdW5zaWduZWQgb3JpZ19lYnA7CiAgICAgICAgICAgICAg
VW5zaWduZWQ2NCBzcmM7CiAgICAgICAgICAgICAgdW5zaWduZWQgcmVmX2V2ZW50OwogICAgICAg
ICAgICAgIGNoYXIgaGF2ZV9zZW5kOwogICAgICAgICAgICB9IGlwY19yZXM7CiAgICAgICAgICBz
dHJ1Y3QgX19hdHRyaWJ1dGVfXygocGFja2VkKSkKICAgICAgICAgICAgewoKICAgICAgICAgICAg
ICB1bnNpZ25lZCBsb25nIGxvbmcgc2VuZF90c2M7CiAgICAgICAgICAgICAgVW5zaWduZWQ2NCBz
ZW5kX2VzaV9lZGk7CiAgICAgICAgICAgICAgVW5zaWduZWQ2NCByZWN2X2VzaV9lZGk7CiAgICAg
ICAgICAgICAgTXdvcmQgZG9wZTsKICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyIHNlbmRfZGVz
YywgcmVjdl9kZXNjOwogICAgICAgICAgICB9IGlwY190cmFjZTsKICAgICAgICAgIHN0cnVjdCBf
X2F0dHJpYnV0ZV9fKChwYWNrZWQpKQogICAgICAgICAgICB7CgogICAgICAgICAgICAgIHVuc2ln
bmVkIHBmYTsKICAgICAgICAgICAgICB1bnNpZ25lZCBlcnI7CiAgICAgICAgICAgIH0gcGY7CiAg
ICAgICAgICBzdHJ1Y3QgX19hdHRyaWJ1dGVfXygocGFja2VkKSkKICAgICAgICAgICAgewoKICAg
ICAgICAgICAgICBjaGFyIG1zZ1szNV07CiAgICAgICAgICAgIH0ga2U7CiAgICAgICAgICBzdHJ1
Y3QgX19hdHRyaWJ1dGVfXygocGFja2VkKSkKICAgICAgICAgICAgewoKICAgICAgICAgICAgICB1
bnNpZ25lZCBlYXgsIGVkeCwgZWN4OwogICAgICAgICAgICAgIGNoYXIgbXNnWzIzXTsKICAgICAg
ICAgICAgfSBrZV9yZWc7CiAgICAgICAgICBzdHJ1Y3QgX19hdHRyaWJ1dGVfXygocGFja2VkKSkK
ICAgICAgICAgICAgewoKICAgICAgICAgICAgICBNd29yZCBmcGFnZTsKICAgICAgICAgICAgICB1
bnNpZ25lZCBtYXNrOwogICAgICAgICAgICAgIGJvb2wgcmVzdWx0OwogICAgICAgICAgICB9IHVu
bWFwOwogICAgICAgICAgc3RydWN0IF9fYXR0cmlidXRlX18oKHBhY2tlZCkpCiAgICAgICAgICAg
IHsKCiAgICAgICAgICAgICAgdW5zaWduZWQgbHRocmVhZDsKICAgICAgICAgICAgICB1bnNpZ25l
ZCBvbGRfZXNwOwogICAgICAgICAgICAgIHVuc2lnbmVkIG5ld19lc3A7CiAgICAgICAgICAgICAg
dW5zaWduZWQgb2xkX2VpcDsKICAgICAgICAgICAgICB1bnNpZ25lZCBuZXdfZWlwOwogICAgICAg
ICAgICB9IGV4X3JlZ3M7CiAgICAgICAgICBzdHJ1Y3QgX19hdHRyaWJ1dGVfXygocGFja2VkKSkK
ICAgICAgICAgICAgewoKICAgICAgICAgICAgICB1bnNpZ25lZCBhZGRyOwogICAgICAgICAgICAg
IHVuc2lnbmVkIGxlbjsKICAgICAgICAgICAgICB1bnNpZ25lZCB2YWx1ZTsKICAgICAgICAgICAg
ICB1bnNpZ25lZCBjaGFyIG1vZGU7CiAgICAgICAgICAgIH0gYnA7CiAgICAgICAgICBzdHJ1Y3Qg
X19hdHRyaWJ1dGVfXygocGFja2VkKSkKICAgICAgICAgICAgewoKICAgICAgICAgICAgICB1bnNp
Z25lZCBlYXgsIGVicCwgZWN4OwogICAgICAgICAgICAgIFVuc2lnbmVkNjQgZGVzdDsKICAgICAg
ICAgICAgICBjaGFyIGlzX2lycSwgc25kX2xzdCwgZHN0X29rLCBkc3RfbGNrOwogICAgICAgICAg
ICB9IGlwY19zZmw7CiAgICAgICAgICBzdHJ1Y3QgX19hdHRyaWJ1dGVfXygocGFja2VkKSkKICAg
ICAgICAgICAgewoKICAgICAgICAgICAgICBDb250ZXh0ICpkZXN0OwogICAgICAgICAgICAgIHVu
c2lnbmVkIGtlcm5lbF9laXA7CiAgICAgICAgICAgICAgdW5zaWduZWQgbG9uZyAqa2VybmVsX3Nw
OwogICAgICAgICAgICB9IGN0eF9zdzsKICAgICAgICB9IG07CiAgICAgIGNoYXIgdHlwZTsKICAg
IH0gVGJfZW50cnk7CgoKICBzdGF0aWMgdm9pZCBfX2F0dHJpYnV0ZV9fKChyZWdwYXJtKDMpKSkg
KCppbml0X3BtYykodW5zaWduZWQgZXZlbnQsIGludCB1c2VyLCBpbnQga2VybmVsKTsKCiAgc3Rh
dGljIHZvaWQgX19hdHRyaWJ1dGVfXygocmVncGFybSgzKSkpICgqcmVhZF9wbWMpKFRiX2VudHJ5
ICp0YmUpOwoKICBzdGF0aWMgTG9nX2V2ZW50ICogY29uc3QgbG9nX2V2ZW50c1tdOwoKcHJpdmF0
ZToKICBzdGF0aWMgVGJfZW50cnkgKnRidWY7CiAgc3RhdGljIFRiX2VudHJ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JCQlcblx0IgoKICAgICJjYWxsICIgInBy
b2ZpbGVfbWNvdW50X3dyYXAiICJcblx0IgogICAgImFkZGwgJDgsJWVzcAkJXG5cdCIKCiAgICAi
cG9wbCAlZWR4CQkJXG5cdCIKICAgICJwb3BsICVlY3gJCQlcblx0IgogICAgInBvcGwgJWVheAkJ
CVxuXHQiCiAgICAicmV0Iik7Cg==



More information about the Gcc-bugs mailing list