From mboxrd@z Thu Jan 1 00:00:00 1970 From: "John David Anglin" To: dave@hiauly1.hia.nrc.ca (John David Anglin) Cc: jsm28@cam.ac.uk, gcc-patches@gcc.gnu.org Subject: Re: PATCH: fix argument promotion Date: Mon, 04 Jun 2001 10:53:00 -0000 Message-id: <200106041753.NAA18075@hiauly1.hia.nrc.ca> References: X-SW-Source: 2001-06/msg00157.html > #include > > int f (int a, int b, int c, _Bool d, _Bool e, _Bool f, char g) > { > if (g != 1 || d != true || e != true || f != true) abort (); > return a + b + c; > } > > main () > { > exit (f (1, 2, -3, true, true, true, '\001')); > } > The above code exposes the bug in the existing C compiler because cc1 currently promotes boolean types before a call but doesn't demote them in the callee. The test passes with cc1plus because it isn't promoting or demoting booleans at all. If anybody has a brilliant idea on how to test for this let me know. Dave -- J. David Anglin dave.anglin@nrc.ca National Research Council of Canada (613) 990-0752 (FAX: 952-6605)