./xgcc -B ./ -O2 jsnum.ii -fdump-ipa-all leads to two cgraph nodes to the same asm name: jsval js::ValueToNumberSlow(JSContext*, jsval, double*)/1083(913) @0x7ffff613b810 (asm: _ZN2js17ValueToNumberSlowEP9JSContextlPd) analyzed 276 time, 36 benefit 114 size, 27 benefit needed reachable body finalized inlinable called by: bool js::ValueToNumberValueSlow(JSContext*, jsval*, double*)/1084 (1.00 per call) (can throw external) bool js::ValueToNumberValueSlow(JSContext*, jsval*)/1085 (1.00 per call) (can throw external) bool js::ValueToECMAInt32Slow(JSContext*, jsval, int32_t*)/1086 (1.00 per call) (can throw external) bool js::ValueToECMAUint32Slow(JSContext*, jsval, uint32_t*)/1087 (1.00 per call) (can throw external) bool js::ValueToInt32Slow(JSContext*, jsval, int32_t*)/1089 (1.00 per call) (can throw external) bool js::ValueToUint16Slow(JSContext*, jsval, uint16_t*)/1090 (1.00 per call) (can throw external) calls: JSBool JSVAL_IS_PRIMITIVE(jsval)/50 (1.00 per call) JSBool JSObject::defaultValue(JSContext*, JSType, jsval*)/485 (1.00 per call) (can throw external) JSObject* JSVAL_TO_OBJECT(jsval)/53 (1.00 per call) JSBool JSVAL_IS_VOID(jsval)/49 (1.00 per call) jsval INT_TO_JSVAL(jsint)/60 (1.00 per call) JSBool JSVAL_IS_NULL(jsval)/48 (1.00 per call) jsval INT_TO_JSVAL(jsint)/60 (1.00 per call) jsval INT_TO_JSVAL(jsint)/60 (1.00 per call) JSBool JSVAL_TO_BOOLEAN(jsval)/61 (1.00 per call) JSBool JSVAL_IS_BOOLEAN(jsval)/47 (1.00 per call) int JSDOUBLE_IS_NaN(jsdouble)/821 (1.00 per call) T js::StringToNumberType(JSContext*, JSString*) [with T = double, JSContext = JSContext, JSString = JSString]/1144 (1.00 per call) (can throw external) JSString* JSVAL_TO_STRING(jsval)/55 (1.00 per call) JSBool JSVAL_IS_STRING(jsval)/45 (1.00 per call) jsdouble* JSVAL_TO_DOUBLE(jsval)/54 (1.00 per call) JSBool JSVAL_IS_DOUBLE(jsval)/43 (1.00 per call) jsint JSVAL_TO_INT(jsval)/59 (1.00 per call) JSBool JSVAL_IS_INT(jsval)/42 (1.00 per call) References: var:jsdouble js_NaN (read) Refering this function: and jsval js::ValueToNumberSlow(JSContext*, jsval, double*)/1294(-1) @0x7ffff5f4d968 (asm: _ZN2js17ValueToNumberSlowEP9JSContextlPd) availability:not_available reachable called by: calls: References: Refering this function: this eventually leads to confussion in my new symtab code that eventually confuses gold and leads to mozilla build failure. Honza
Created attachment 21114 [details] testcase
This is a front-end issue. There is another bug about this issue too.
PR 20357.
Subject: Re: Violation of one-definition rule Mine is bit more stuble since the duplicated decl does nolead to linker error unless LTO is used, but might be same or smilar problem. I made workaround for now and can confirm that the wrong decl is used in call that appears already in .eh dump, so it comes from frontend. This is something that really ought to be fixed... Seem it is there for a while. Honza
>Mine is bit more stuble It might be more subtle but it is the same issue, as we have two FUNCTION_DECL which are the same: __attribute__((always_inline)) inline bool ValueToNumber(JSContext *cx, jsval v, double *out) { .... extern jsval ValueToNumberSlow(JSContext *, jsval, double *); return !JSVAL_IS_NULL(ValueToNumberSlow(cx, v, out)); } .... namespace js { jsval ValueToNumberSlow(JSContext *cx, jsval v, double *out) { ... Which points to the same issue as PR 20357 where we have the same semantic issue of the function decls.
Created attachment 21115 [details] Workaround patch to let mozilla build to proceed.
The workaround was comitted to the mainline, but the duplicated decl issue probably remains.
With workaround we no longer affect mozilla.